import React, { Component } from 'react';
import { Route,Switch,Redirect } from 'react-router-dom';

import Message from "./Message/index.jsx";
import News from "./News/index.jsx";
import MyNavLink from "../MyNavLink/index.jsx";

export default class Home extends Component {
    render() {
        return (
            <div>
                <div>我是Home页面</div>
                <div>
                    <ul className="nav nav-tabs">
                        <li>
                            {/* <a className="list-group-item active" href="./home-news.html">News</a> */}
                            <MyNavLink to="/home/news">News</MyNavLink>
                        </li>
                        <li>
                            {/* <a className="list-group-item " href="./home-message.html">Message</a> */}
                            <MyNavLink to="/home/message">Message</MyNavLink>
                        </li>
                    </ul>
                    <Switch>
                        <Route path="/home/news" component={News}></Route>
                        <Route path="/home/message" component={Message}></Route>
                        <Redirect to="/home/news"></Redirect>
                    </Switch>
                </div>
            </div>
        )
    }
}